<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ page import="java.sql.*" %>
<html>
<head>
<title>添加结果</title>
</head>  
<body><font size=4>
<%
String w=request.getParameter("user");
String y=request.getParameter("password");
String y2=request.getParameter("password2");


if((w==null||w.equals(""))||(y==null||y.equals(""))||(y2==null||y2.equals("")))
{

	 %> <script type="text/javascript">
       alert("信息不全，请重新输入",window.location.href="zhuce.jsp");
       </script>
     <%
}
else
{

if(y.equals(y2)==true)
{

	Connection con=null;
    Statement sql=null;
    ResultSet rs=null;
    
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
   con=DriverManager.getConnection("jdbc:odbc:shujuku01");
   sql=con.createStatement();
   String condition="insert into user(user,password) values"+"("+"'"+w+"','"+y+"')";
   sql.executeUpdate(condition);
%>
  
 <script type="text/javascript">
  alert("注册成功",window.location.href="denglu.jsp");
 </script>
<%
}
else
{
%>
   <script type="text/javascript">
  alert("密码不同，请重新输入",window.location.href="zhuce.jsp");
 </script>
<%
}
}
%>
	
	
</table>
</center>
</font>
</body>
</html>